package me.wz.util.sdbc;

import java.util.List;
import java.util.Map;

public interface ISdbc {
    public <T> List<T> select(T bean);
    public <T> List<T> select(Class<T> clazz);
    public List<Map<String, Object>> select(String select);
    public List<Map<String, Object>> select(String select, Map<String, Object> params);
    public <T>List<T> select(String select, Map<String, Object> params, Class<T> clazz);

    public <T>List<T> list(T bean);
    public <T> List<T> list(Class<T> clazz);
    public List<Map<String, Object>> list(String select);
    public List<Map<String, Object>> list(String select, Map<String, Object> params);
    public <T>List<T> list(String select, Map<String, Object> params, Class<T> clazz);


    public <T>Page<T> page(T bean, Pagination pagination);
    public <T>Page<T> page(Class<T> clazz, Pagination pagination);
    public Page<Map<String, Object>> page(String select, Pagination pagination);
    public Page<Map<String, Object>> page(String select, Map<String, Object> params, Pagination pagination);
    public <T>Page<T> page(String select, Map<String, Object> params, Class<T> clazz, Pagination pagination);

    public <T>T get(T bean);
    public <T>T get(T bean, boolean isUnique);
    public <T>T get(Class<T> clazz, Object id);
    public <T>T get(String select, Map<String, Object> params, Class<T> clazz, boolean isUnique);

    public <T>int insert(T bean);
    public <T>int[] insert(List<T> beans);

    public <T>int delete(T bean);

    public <T>int update(T bean);
    public int update(String sql);
    public int update(String sql, Map<String, ?> params);
    public int[] update(String sql, Map<String, ?>[] batchValues);

    public int execute(String sql);
    public int execute(String sql, Map<String, ?> params);
    public <T>T execute(IExecute<T> execute);
}
